package com.xr.service.impl;

import com.xr.mapper.UsersMapper;
import com.xr.model.Users;
import com.xr.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Zephyr.Liu
 * @date 2020/6/9 16:34
 * @Description
 */
@Service
public class UserServiceImpl implements UsersService {

    @Autowired
    private UsersMapper usersMapper;


    @Override
    public Users login(Users users) {
        Users loginUser = usersMapper.findByName(users.getName());
        if(loginUser!=null && loginUser.getName().equals(users.getName()) && loginUser.getPassword().equals(users.getPassword())){
            return loginUser;
        }
        return null;
    }
}
